package com.cloudfun.campusshare.device.protocol.decoder;

import com.cloudfun.campusshare.device.protocol.response.TypeId;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Huqin on 2020/4/23
 */
public class TypeIdDecoder extends ByteToMessageDecoder<TypeId> {

    private List<FieldDecoder<TypeId>> fieldDecoderList;

    public TypeIdDecoder() {
        fieldDecoderList = new ArrayList<>();
        fieldDecoderList.add(new PlainHexStringFieldDecoder<>(0, 32, TypeId::setTypeId));
    }

    @Override
    protected List<FieldDecoder<TypeId>> fieldDecoderList() {
        return fieldDecoderList;
    }

    @Override
    protected TypeId prepare() {
        return new TypeId();
    }
}
